package sin.dao.impl;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Component;

import sin.dao.StudentDao;
import sin.entity.Student;

@Component("studentDao")
public class StudentDaoImpl extends HibernateDaoSupport implements StudentDao {

	@Override
	public Student getById(String id) {
		return (Student) this.getSession().get(Student.class, id);
	}

	@Override
	public void saveStudent(Student student) {
		this.getSession().save(student);
	}

	@Override
	public void deleteById(String id) {
		Object stu = this.getSession().get(Student.class, id);
		this.getSession().delete(stu);
	}

}
